<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        'use strict';

        //ES6新特性map和set

        //map中key不重复
        let maps = new Map([["lx",99],["hwq",100]]);
        //根据key获取map中对应的值
        maps.get('hwq');
        //map中新增或修改key、value
        maps.set("hei",100);
        //map中删除指定key
        maps.delete('hei');

        //set无序不重复集合
        let sets = new Set([1,2,3,3,3,4,"hwq",'ha']);
        //判断一个元素是否处于set集合中
        sets.has(1);
        //Set中新增元素
        sets.add("lx");
        //删除Set集合中指定元素
        sets.delete('ha');

        console.log("通过for of遍历map集合");
        for (let map of maps) {
            console.log(map);
        }
        console.log("通过for of遍历set集合");
        for (let s of sets) {
            console.log(s);
        }
    </script>
</head>
<body>

</body>
</html>